<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateActivityAuditRequestsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('activity_audit_requests', function (Blueprint $table) {
            $table->bigIncrements('id')->unsigned();

            $table->integer('activity_id')->unsigned()->comment('关注的活动id');
            $table->foreign('activity_id')->references('id')->on('activities');

            $table->dateTime('request_time')->nullable()->comment('申请时间');

            $table->dateTime('process_time')->nullable()->comment('处理时间');

            $table->tinyInteger('process_result')->default(0)->nullable()->comment('处理结果：0=不通过，1=通过');
            $table->string('deny_reason', 200)->nullable()->comment('不通过的原因');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('activity_audit_requests');
    }
}
